package com.api.shopapi.service.impl;


import com.api.shopapi.entity.Area;
import com.api.shopapi.mapper.AreaMapper;
import com.api.shopapi.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("AreaServiceImplOne")
public class AreaServiceImpl implements AreaService {

    @Autowired
    private AreaMapper areaMapper;

    @Override
    public int insert(Area area){
        return areaMapper.insert(area);
    }

    @Override
    public int deleteByAreaCode(String areaCode){
        return areaMapper.deleteByAreaCode(areaCode);
    }

    @Override
    public int updateByAreaCode(Area area){
        return areaMapper.updateByAreaCode(area);
    }

    @Override
    public Area getByAreaCode(String areaCode){
        return areaMapper.getByAreaCode(areaCode);
    }

    @Override
    public List<Area> getList(){
        return areaMapper.getList();
    }

    @Override
    public List<Area> getListByParentAreaCode(String parentAreaCode){
        return areaMapper.getListByParentAreaCode(parentAreaCode);
    }


}
